package com.freemarker.product;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class SpringWithFreemarker {
	@RequestMapping("/hello")
	public String hello(HttpServletRequest request,ModelMap model){
		
		request.setAttribute("tag", "taaaa");
		model.addAttribute("title", "标题");
		model.addAttribute("content","内容");
		return "hello";
	}
	@RequestMapping("/article")
	public String article(HttpServletRequest request,ModelMap model){
		model.put("article_id", new ArticleDirective());
		return "article";
	}
	@RequestMapping("/timestamp")
	public String timestamp(HttpServletRequest request,ModelMap model){
		model.put("article_id", new ArticleDirective());
		return "timestamp";
	}
}
